# -*- coding: utf-8 -*-

"""
Module implementing Form.
"""

from PyQt4.QtGui import QWidget
from PyQt4.QtCore import pyqtSignature

from Ui_ccbrowse-gui import Ui_Form

class Form(QWidget, Ui_Form):
    """
    Class documentation goes here.
    """
    def __init__(self, parent = None):
        """
        Constructor
        """
        QWidget.__init__(self, parent)
        self.setupUi(self)
    
    @pyqtSignature("")
    def on_findButton_clicked(self):
        """
        Button Clicked to initiate find
        """
        # TODO: get contents of combobox and serach string
        # TODO: asssemple request
        # TODO: send query to relevant backend
        #TODO: Receive result object
        #TODO: Populate item table with result elements
        raise "Not implemented yet"
    
    @pyqtSignature("int, int")
    def on_tableWidget_cellClicked(self, row, column):
        """
        Slot documentation goes here.
        """
        # TODO: not implemented yet
        # TODO: not implemented yet
        # TODO: not implemented yet
        # TODO: not implemented yet
        # TODO: not implemented yet
        # TODO: not implemented yet
        raise "Not implemented yet"
    
    @pyqtSignature("int, int")
    def on_tableWidget_cellDoubleClicked(self, row, column):
        """
        Slot documentation goes here.
        """
        # TODO: Fetch real image
        # TODO: save to temp file?
        # TODO: pass image location back to front-end script
        # TODO: also pass info to be dealt with as appropriate
        raise "Not implemented yet"
